// custom-tab-bar/index.ts
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    selected: 0,
    color: "#7A7E83",
    selectedColor: "#3cc51f",
    list: [{
      "pagePath": "/pages/index/index",
      "iconPath": "/static/img/index.png",
      "selectedIconPath": "/static/img/index_s.png",
  
    }, {
      "pagePath": "/pages/tools/tools",
      "iconPath": "/static/img/tool.png",
      "selectedIconPath": "/static/img/tool_s.png",
 
    },{
      "pagePath": "/pages/me/me",
      "iconPath": "/static/img/my.png",
      "selectedIconPath": "/static/img/my_s.png",
 
    }]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    switchTab(e:any) {
      console.log("执行跳转", e);
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({
        url
      })
      this.setData({
        selected: data.index
      })
    }
  }
})

